/*
 * @Author: 葛文杰
 * @Date: 2021/2/1 09:33
 * @Description: egg app.js
 */

module.exports = app => {
    app.once('server', server => {
        // websocket
    });
    app.on('error', (err, ctx) => {
        // report error
    });
    app.on('request', ctx => {
        // log receive request
    });
    app.on('response', ctx => {
        // ctx.starttime is set by framework
        const used = Date.now() - ctx.starttime;
        console.log(used);
        // log total cost
    });
};
